#7 ✓hold
Lar Van Der Jagt

rake spec:plugin fails on rails 2.1

Reported by Lar Van Der Jagt | August 19th, 2008 @ 03:07 AM

I am trying to test my plugins and it seems there are some problems with the specs for the generators. I am able to run the generator fine & all tests pass within my app, but some of the templates fail. The trace is rather long, you can see it at the following link:

pastie for failing plugin specs

Comments and changes to this ticket

  • mrflip

    mrflip August 19th, 2008 @ 09:44 AM

    Is it trying to run the files in the gen/auth'd/templates/spec directory?

    Would you try renaming that directory to spec_t or foo or something and retrying?

  • mrflip

    mrflip August 19th, 2008 @ 09:44 AM

    • State changed from “new” to “open”
  • Lar Van Der Jagt

    Lar Van Der Jagt August 19th, 2008 @ 10:13 AM

    Yes, it is trying to run the files in that directory. Renaming it seems to stop the restful_auth errors, but it looks like make_resourceful is acting up as well. Here is the pastie just in case it is useful

    http://pastie.org/255704

    Are those files not meant to be run by rake spec:plugins? Are they just the generator files for the specs, and not actual specs?

  • mrflip

    mrflip August 19th, 2008 @ 01:19 PM

    • State changed from “open” to “hold”
    • Tag changed from template to generator, rspec, template

    Exactly -- they are not meant to be run by the specs (being as they are .erb files)

    This feels like a bug in either rspec or rails generators, not rest_auth. Do you feel like filing a bug or a patch with rspec?

    • The files are named "foo.rb", though they are technically "foo.rb.erb" files. However, the universal convention -- taking a quick tour of all the plugin generators I have -- is for foo.rb. This is the actual bug, but it is general across every generator.

    • The best concession to that reality would seem to me: have rake:rspec:plugin exclude any directory matching

    
      generators/*/templates/.
    
    • If they don't seem excited about fixing it I'll rename the dir to spec_t or something.
  • Lar Van Der Jagt

    Lar Van Der Jagt August 19th, 2008 @ 01:25 PM

    So RSpec is just finding the generators for restful_auth specs and running them as actual plugin specs?

    I will see what I can do about reporting this to the RSpec people or working up a patch.

  • mrflip

    mrflip August 19th, 2008 @ 01:31 PM

    The error on make_resourceful looks different, but yeah -- it looks like for rest_auth it's running them as plugin specs. If there's a convention for renaming the dir, or something, then we'll move to it; let them know they can kick the bug back to here.

  • mrflip

    mrflip August 19th, 2008 @ 01:35 PM

    The error on make_resourceful looks different, but yeah -- it looks like for rest_auth it's running them as plugin specs. If there's a convention for renaming the dir, or something, then we'll move to it; let them know they can kick the bug back to here.

  • Lar Van Der Jagt

    Lar Van Der Jagt August 19th, 2008 @ 02:08 PM

    I filed a ticket on rspec, and also found a temporary workaround. I added the following to the end of line 58 in the lib/tasks/rspec.rake file generated from rspec.

    
    .exclude('vendor/plugins/**/templates/*')
    

    Seems better than modifying the plugin structure, since the task is actually part of my app.

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

Restful Authentication Generator

This widely-used plugin provides a foundation for securely managing user
authentication:
* Login / logout
* Secure password handling
* Account activation by validating email
* Account approval / disabling by admin
* Rudimentary hooks for authorization and access control.

http://github.com/technoweenie/restful-authentication/tree

People watching this ticket

Pages